import { List, Modal, Grid, DatePickerView, Toast } from 'antd-mobile';
import { Button, Divider, Alert } from 'antd';
import moment from 'moment';
import React, { useState } from 'react';
import { connect, history, useRequest } from 'umi';
import { PlusCircleFilled } from '@ant-design/icons';
import BackIcon from '@/components/BackIcon';
import { useEffect } from 'react';
import { putFetch } from '@/utils/doFetch';
import { useMemo } from 'react';
import PublicList from '@/components/PublicList';
import { account_book } from '@/services/factory';
import styles from './index.less';

let Header = connect(({ global, loading }) => ({
  global,
  loading,
}))(({ global: { userinfo, companies } }) => {
  return (
    <div className={styles.adds}>
      <div style={{ fontSize: 16 }} className="oneline">
        {companies?.name} 的档案
      </div>
    </div>
  );
});

let Resource = connect(({ global, loading }) => ({
  global,
  loading,
}))(({ global: { userinfo, companies } }) => {
  return (
    <div style={{ height: '100%' }}>
      <BackIcon></BackIcon>
      <PublicList
        Header={Header}
        post={account_book}
        type="account_book"
        params={{ company_id: companies?.id }}
      ></PublicList>
    </div>
  );
});

export default connect(({ global, loading }) => ({
  global,
  loading,
}))(Resource);
